version: '3.1'
services:
  httpd:
    build:
      context: ./httpd
    depends_on:
      - db
    ports:
      - 80:80
    volumes:
      - ./www:/var/www/html:rw
      - ./sites-available:/etc/apache2/sites-available
  db:
    container_name: db
    image: mariadb
    environment:
      MYSQL_ROOT_PASSWORD: docker
    ports:
      - 3306:3306
    expose:
      - "3306"
    volumes:
      - db_data:/var/lib/mysql
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    depends_on:
      - db
    ports:
      - 8181:80
    environment:
      PMA_USER: root
      PMA_PASSWORD: docker
volumes:
  db_data:
